/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-03-23     greec       the first version
 */
#ifndef APPLICATIONS_KEY_H_
#define APPLICATIONS_KEY_H_


#include "include.h"



#define PIN_KEY1                GET_PIN(B, 14)//27      //PB14
#define PIN_KEY2                GET_PIN(B, 13)//26      //PB13

#define PIN_DOOR_CLOSE          GET_PIN(C, 13)//2       //PC13

#define PIN_LIMIT_UP            GET_PIN(C, 14)//3       //PC14
#define PIN_LIMIT_DOWN          GET_PIN(C, 15)//4       //PC15


#define KEY1                    (rt_pin_read(PIN_KEY1)?0:1)&init_cpl
#define KEY2                    (rt_pin_read(PIN_KEY2)?0:1)&init_cpl

#define LIMIT_UP                rt_pin_read(PIN_LIMIT_UP)
#define LIMIT_DOWN              rt_pin_read(PIN_LIMIT_DOWN)
#define DOOR_CLOSE              rt_pin_read(PIN_DOOR_CLOSE)




void key_init(void);

#endif /* APPLICATIONS_KEY_H_ */
